package com.hingsmy.pma.dao;

import com.hingsmy.pma.antities.Project;
import com.hingsmy.pma.dao.dto.ChartData;
import org.springframework.data.jpa.repository.Query;
import  org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import  java.util.List;

@Repository
public interface ProjectRepository extends CrudRepository<Project,Long>{
    @Override
     List<Project>findAll();

    @Query(nativeQuery = true,value = "SELECT stage as label,COUNT(*) as value  FROM  project GROUP BY stage")
    List<ChartData>getProjectStatus();

    List<Project> getAll();
}
